#! -*- coding:utf-8 -*-

if '下一页' == '下一页':
    print('equal')

age = 20
if age > 2:
    print("a")
elif age < 90:
    print("b")

a8 = 0
for x in [1, 2, 3, 4, 5, 6, 6, 4, 4, 3, 3]:
    a8 += x
print(a8)

n = 99
while n > 0:
    a8 += n
    n -= 1
print(a8)


def hello(x):
    if x > 0:
        return x
    else:
        return -x


print(hello(3))

# def printName(name):
#     if not isinstance(name, str):
#         return
#     print("name is -->", name)
#
#
# printName("sadfas")
# printName(234)

print("==============================")


# *为可变参数，参数封装为tuple
def calc(*number):
    total = 0
    for n in number:
        total += n
    return total


print(calc(1, 2, 3, 4, 5, 5, 6))
print(calc())
print("==============================")


# **为关键字参数，参数封装为dict
def person(name, age, **kw):
    print('name:', name, 'age:', age, 'other:', kw)


person("hello", 20)
person("hi", 25, city='Beijing')


def person(name):
    print(name)


person("asdfasdf")


# 关键字参数 *，XX，XX
def person(name, age, *, city, job):
    print('name:', name, 'age:', age, 'other:', city, job)


person("asdf", 123, city="asdf", job="asdfas")


def fact(n):
    if n == 1:
        return 1
    return n * fact(n - 1)


print(fact(9))


student = {
	'id': '20170101',
	'name': 'Jordan',
	'age': 20,
	'gender': 'male'
}

